<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="format-detection" content="telephone=no"/>
  <meta http-equiv="pragma" content="no-cache">
  <meta http-equiv="cache-control" content="no-cache">
  <meta http-equiv="expires" content="0">
  <title>登录</title>
  <link rel="stylesheet" href="__EXTEND__/login/css/register.css">
  <link rel="stylesheet" href="__EXTEND__/login/css/project.css">
  <link href="__EXTEND__/lib/layer/2.4/skin/layer.css" rel="stylesheet" type="text/css" />
  <script src="__EXTEND__/login/js/jquery-1.12.2.js"></script>
  <!--[if lt IE 9]>
  　　<script src="__EXTEND__/login/js/html5shiv.js"></script>
  <![endif]-->
</head>
<body>
<div class="body">
  <div class="register_div">
    <div class="register_fl">

    </div>
    <div class="register_fr">
      <!--<img style="width: 100%;height: 100%" src="img/register_1.jpg" alt="">-->
      <form id="form_login" class="form form-horizontal" action="{{:U('Admin/Public/login')}}" method="post">
        <h1>"最多跑一趟"<br>在线审批系统后台</h1>
        <span>Welcome login!</span>
        <input id="username" name="username" type="text" placeholder="请输入用户名">
        <input id="password" name="password" type="password" placeholder="请输入密码">

        <lable>
          <span style="color: red;" class="check-tips"></span>
        </lable>
        <span id="wait_img" style="display:none"><img style="width:31px;" src="__PUBLIC__/default/loading-1.gif"></span>
        <button id="submit"><a href="" >登&nbsp;&nbsp;录</a> </button>
        <p class="banquan">版权所有：湖州交警支队</p>
      </form>

    </div>
  </div>
</div>
<!--[if lt IE 9]>
<script type="text/javascript" src="__STATIC__/jquery-1.10.2.min.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<!--<![endif]-->

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__EXTEND__/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__EXTEND__/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer /作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__EXTEND__/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script>
    var height = $(window).height();
    $('.body').css('height',height);
</script>
<script type="text/javascript">
    $(function(){
        //表单验证
        $("#form_login").validate({
            rules: {
            },
            onkeyup: false,
            focusCleanup: true,
            success: "valid",
            submitHandler: function (form) {
                $("form").ajaxSubmit({
                    type: 'post',
                    url: "{{:U('Admin/Public/login')}}",
                    beforeSend:function(){
                        $(".check-tips").text("");
                        $('#submit').hide();
                        $('#wait_img').show();
                    },
                    success: function (data) {
                        $('#wait_img').hide();
                        $('#submit').show();
                        if(data.status){
                            layer.msg("登录成功",{time:500});
                            setTimeout((function() {
                                window.location.href = "{{:U('Admin/Index/index')}}";
                            }), 500);
                        } else {
                            $(".check-tips").text('*'+data.info);

                        }
                    },
                    error: function (XmlHttpRequest, textStatus, errorThrown) {
                        layer.msg('error!', {icon: 5, time: 1000});
                    }
                });
            }
        });


    });
</script>

</body>
</html>